var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.npc_ChangeController(3004302, "oid=367456", 1141, -538, 2, 1091, 1191, 0, false, 0, false);
            cm.npc_ChangeController(3004303, "oid=367457", 1074, -538, 2, 1055, 1124, 0, false, 0, false);
            cm.npc_ChangeController(3004330, "oid=367458", 1490, -538, 2, 1440, 1490, 1, false, 0, false);
            cm.npc_ChangeController(3004300, "oid=367459", 996, -538, 3, 991, 1015, 1, false, 0, false);
            cm.npc_ChangeController(3004335, "oid=2783822", 1324, -540, 2, 1274, 1374, 1, false, 0, false);
            cm.npc_SetSpecialAction("oid=2783822", "summon", 0, 0);
            cm.npc_SetSpecialAction("oid=2783822", "special2", cm.getQuestStatus(37308) > 0 ? 1 : -1, 1);
            cm.dispose()
        }
    }
};